{% extends 'base.html' %}
{%block content%}

{% if form.errors %}
 <p>the entered username or wrong password, please retry </p>
{% endif %}
{% if next %}
    {% if user.is_authenticated %}
    <p>you dont have permission to access this page. please login with another account</p>
    {% else %}
    <p>please login first</p>
    {% endif %}
{% endif %}
<h1>sanku shop login page</h1>
<form method="post" action="{% url 'login' %}">
    {%csrf_token%}
    <table>
        <tr>
            <td>user name:</td>
            <td>{{form.username}}</td>
        </tr>
        <tr>
            <td>password:</td>
            <td>{{form.password}}</td>
        </tr>
    </table>
    <input type="submit" value="login">
    <input type="hidden" name="next" value="{{next}}">
</form>
{% endblock %}